function validateForm(){
	
	var x=document.forms["upload"]["file"].value;
	
	if(x==null||x==""){
		alert("You must select an image file  to upload first");
		return false;
	}
	
	var valid_extensions = /(.jpg|.gif|.jpeg|.bmp|.png|.tiff|.ico|.webp)$/i;
	
		if (valid_extensions.test(x)){
			return true;
		} else {
			alert("You must select an image file, of type: .jpg .gif .bmp .png .tiff .ico .webp");
			return false;
		}
	
}